﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyStorage;

namespace ElectricBillMaker
{
    public interface IDatabase
    {
        void AddRegistration(MyStorage.Registration registration);
        void SubmitChanges();
    }

    class Database
        : IDatabase
    {
        private Db db_;

        public Database(string dbName)
        {
            db_ = new Db(dbName);
        }

        public void AddRegistration(MyStorage.Registration registration)
        {
            db_.Registrations.InsertOnSubmit(registration);
        }

        public void SubmitChanges()
        {
            db_.SubmitChanges();
        }
    }
}
